package com.dankegongyu.lib.common.util.statusbar;

import androidx.annotation.ColorRes;

/**
 * @author wupuquan
 * @version 1.0
 * @since 2018/7/24 16:01
 */
public class DKStatusBarConfig {

    private boolean useCustomStatusBar;
    private int statusBarMode;
    private int statusBarColor;

    private DKStatusBarConfig() {
    }

    public static DKStatusBarConfig getInstance() {
        return SingtonHolder.INSTANCE;
    }

    private static class SingtonHolder {
        private static final DKStatusBarConfig INSTANCE = new DKStatusBarConfig();
    }

    /**
     * 是否使用自定义状态栏（如沉浸模式）
     *
     * @param useCustomStatusBar 是否自定义
     */
    public DKStatusBarConfig setUseCustomStatusBar(boolean useCustomStatusBar) {
        this.useCustomStatusBar = useCustomStatusBar;
        return this;
    }

    public boolean useCustomStatusBar() {
        return useCustomStatusBar;
    }

    /**
     * 设置状态栏模式
     *
     * @param statusBarMode {@link DKStatusBarMode}
     */
    public DKStatusBarConfig setStatusBarMode(@DKStatusBarMode int statusBarMode) {
        this.statusBarMode = statusBarMode;
        return this;
    }

    public int getStatusBarMode() {
        return statusBarMode;
    }

    /**
     * 设置状态栏颜色
     *
     * @param statusBarColor color resource
     */
    public DKStatusBarConfig setStatusBarColor(@ColorRes int statusBarColor) {
        this.statusBarColor = statusBarColor;
        return this;
    }

    public int getStatusBarColor() {
        return statusBarColor;
    }
}
